# 注册
users = {'xiaoming': '123456'}
def register():
    username = input('input_user:')
    if username in users:
        print('----register NO------')
    else:
        passwd = input('input_passwd:')
        users[username] = passwd
        # users.update({username: passwd})
    print('register OK', users)

# 登录
def login():
    username = input('input_user: ')
    passwd = input('input_passwd: ')
    if (username, passwd) in users.items():
        print('login OK')
    else:
        print('login NO')

# show_menu
def show_menu():
    while True:
        n = input('input_menu: 1.register 2.login 3.exit \n')
        if n not in ['1', '2', '3']:
            print('input_error')
        elif n == '1':
            register()
        elif n == '2':
            login()
        else:
            break

if __name__ == '__main__':
    # print(users)
    # register()
    # print(users)
    # login()
    show_menu()
